package tcln.sors.client;

import java.awt.Window;

import javax.swing.JComponent;

import org.jdesktop.application.Application;
import org.jdesktop.application.ResourceMap;

import tcln.sors.client.core.mvc.DefaultView;
import tcln.sors.client.core.mvc.ModelData;

/**
 * @param <M>
 *            Model data type.
 * @param <D>
 *            Display component type.
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
public class AbstractSorsView<M extends ModelData<?>, D extends Window> extends DefaultView<M, D> {
    /**
     * {@inheritDoc}
     */
    @Override
    protected void initialize() {
        super.initialize();
        ResourceMap rc = Application.getInstance().getContext().getResourceMap(getClass());
        rc.injectComponents(displayComponent);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected JComponent standardize(JComponent component) {
        component.setFont(SorsApplication.getDefaultFont().toJavaFont());
        return component;
    }
}
